package com.beiding.jsonanalyzer.analyze.query;

import com.beiding.jsonanalyzer.Key;

/**
 * @author 丁常磊
 * @date 2022/6/27 17:06
 */

public class KeyOperator implements SelfQueryGrammar {

    private Key key;

    private NodeQueryBuilder nodeQueryBuilder;

    public KeyOperator(String key,NodeQueryBuilder nodeQueryBuilder) {
        this.key = Key.parse(key);
        this.nodeQueryBuilder = nodeQueryBuilder;
    }

    @Override
    public Object getSelf() {
        return key;
    }

    @Override
    public NodeQueryBuilder getQueryBuilder() {
        return nodeQueryBuilder;
    }
}
